<#include "/layout/header2.ftl" />
<body path="${path}" class="login">

	<script>
		$(function()
		{
			$("#div_form input").keydown(function(e)
			{
				if (e.keyCode == 13)
				{
					save_click();
				}
			});
			
			if ("${(user.id)!}" != "")
			{
				window.location = "${path}/index";
			}
			
		});
	
		function save_click()
		{
			$.simpleValid("#div_form", function(obj)
			{
				$.simpleAjax("/app/login", obj, function(o)
				{
					$.successAlert("登录成功", "save_success()", 1000);
				});
			});
		}
		function save_success()
		{
			window.location = "${path}/index";
		}
	</script>


<div class="am-form am-form-horizontal login" id="div_form">

	<h1 class="am-text-center am-text-xxl">后台管理系统</h1>
	<hr/>

	<div class="am-form-group">
		<div class="am-u-md-12">
			<div class="am-input-group am-radius ">
				<span class="am-input-group-label"><i class="am-icon-user am-icon-sm am-icon-fw"></i></span>
				<input type="text" name="name" placeholder="请输入用户名" class="am-form-field" required/>
			</div>
		</div>
	</div>

	<div class="am-form-group">
		<div class="am-u-md-12">
			<div class="am-input-group am-radius ">
				<span class="am-input-group-label"><i class="am-icon-unlock-alt am-icon-sm am-icon-fw"></i></span>
				<input type="password" name="password" placeholder="请输入密码" class="am-form-field" required/>
			</div>
		</div>
	</div>
	
	<div class="am-form-group">
		<div class="am-u-md-7 am-padding-right-0">
			<div class="am-input-group am-radius ">
				<span class="am-input-group-label"><i class="am-icon-plug am-icon-sm am-icon-fw"></i></span>
				<input type="text" name="__VERIFY__" placeholder="请输入验证码" class="am-form-field" required/>
			</div>
		</div>
		<div class="am-u-md-5">
			<img src="${path}/app/verify" id="img_verify" />
		</div>
	</div>

	<div class="am-form-group">
		<div class="am-u-md-12 am-text-center">
			<a href="javascript:void(0)" onclick="save_click()" class="am-btn am-btn-primary am-btn-block am-radius">
				<i class="am-icon-sign-in am-icon-sm am-icon-fw am-margin-right-sm"></i>登录
			</a>
		</div>
	</div>
</div>

<#include "/layout/footer.ftl" />